home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 / Aminet - June 1993 [Walnut Creek].iso / usenet / sources / volume90 / unix / ls_3_1 / part01 next >
Encoding:
Internet Message Format  |  1990-04-10  |  44.4 KB

  1. Path: xanth!cs.odu.edu!Amiga-Request
  2. From: Amiga-Request@cs.odu.edu (Amiga Sources/Binaries Moderator)
  3. Newsgroups: comp.sources.amiga
  4. Subject: v90i131: ls 3.1 - UNIX-like ls utility, Part01/03
  5. Message-ID: <12128@xanth.cs.odu.edu>
  6. Date: 10 Apr 90 21:24:44 GMT
  7. Sender: tadguy@cs.odu.edu
  8. Reply-To: kim@uts.amdahl.com (Kim E. DeVaughn)
  9. Lines: 1147
  10. Approved: tadguy@cs.odu.edu (Tad Guy)
  11. X-Mail-Submissions-To: Amiga@cs.odu.edu
  12. X-Post-Discussions-To: comp.sys.amiga
  13.  
  14. Submitted-by: kim@uts.amdahl.com (Kim E. DeVaughn)
  15. Posting-number: Volume 90, Issue 131
  16. Archive-name: unix/ls-3.1/part01
  17.  
  18. [ uuencoded executable enclosed.  ...tad ]
  19.  
  20. Here is v3.1 of Justin McCormick's "ls" utility.  Many options, and tho
  21. not quite the exact clone of UN*X ls that I'd like to see, it does come
  22. close if the right flags are used.
  23.  
  24. At least *this* distribution includes the source, so it can be further
  25. tailored to match one's tastes and requirements.
  26.  
  27. Please note that the .o files for the assembly routines are included in
  28. the src directory since Justin uses the CAPE assembler.
  29.  
  30. /kim
  31.  
  32. #!/bin/sh
  33. # This is a shell archive.  Remove anything before this line, then unpack
  34. # it by saving it into a file and typing "sh file".  To overwrite existing
  35. # files, type "sh file -c".  You can also feed this as standard input via
  36. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  37. # will see the following message at the end:
  38. #        "End of archive 1 (of 3)."
  39. # Contents:  ls.doc ls.uu src src/Makefile src/README src/linkfile
  40. #   src/ls.h src/lssup.o.uu src/mycres.a src/mycres.o.uu
  41. # Wrapped by tadguy@xanth on Tue Apr 10 17:22:46 1990
  42. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  43. if test -f 'ls.doc' -a "${1}" != "-c" ; then 
  44.   echo shar: Will not clobber existing file \"'ls.doc'\"
  45. else
  46. echo shar: Extracting \"'ls.doc'\" \(8349 characters\)
  47. sed "s/^X//" >'ls.doc' <<'END_OF_FILE'
  48. X                   LS 3.0 USER DOCUMENTATION
  49. X
  50. X-----------------------------------------------------------------------
  51. X
  52. X     LS 3.0 - A versatile Amiga directory listing utility.
  53. X
  54. XRevision History:
  55. X
  56. X  V1.0    August 1986 Written from scratch by Justin V. McCormick.
  57. X  V2.0  November 1988 Revised for Lattice 5.0 and made 1.3 compatible.
  58. X  V2.1  December 1988 Minor size reduction, fixed a few bugs from 2.0.
  59. X  V2.2  December 1988 Fixed status return and multiple wildcard pathnames.
  60. X  V3.0  July 25, 1989 Instant sorting, best-fit output, new features.
  61. X  V3.1  July 29, 1989 Bug fixes, new output width and height options.
  62. X
  63. XNotices:
  64. X
  65. X  This program is placed in the public domain with the
  66. Xunderstanding that the author makes no claims or guarantees with
  67. Xregard to its suitability for any given application, and that
  68. Xthe author assumes no responsibility for damages incurred by its
  69. Xusage.  Any resemblance of this program to any other program,
  70. Xeither living or dead, is purely coincidental.
  71. X
  72. X  Feel free to borrow this code and make millions of dollars
  73. Xfrom its sale or commercial use, but please give credit where
  74. Xcredit is due.
  75. X
  76. X  Please do not send me money or stolen software!  I enjoy mail,
  77. Xphone calls, and legitimate software contributions of all kinds.
  78. X
  79. X           Thanks for your encouragement and support,
  80. X                      Justin V. McCormick
  81. X
  82. XI can be reached via:
  83. X
  84. X  BIX: jmccormick
  85. XPLINK: JVM
  86. X
  87. XPHONE: 303-290-8429
  88. X
  89. XUSMAIL: 8330 E. Quincy Ave.
  90. X        Bldg. C, #312
  91. X        Denver CO, 80237
  92. X
  93. X
  94. X
  95. XSynopsis:
  96. X---------
  97. X
  98. X  Features intelligent columnar listing, versatile sort options,
  99. XUNIX-style pattern matching, recursive subdirectory listing,
  100. Xcustomized output formatting and much more!
  101. X
  102. XUsage:
  103. X        LS [options] [pattern1] [pattern2] ...
  104. X
  105. X
  106. XInstallation:
  107. X-------------
  108. XLS can be put in your C: directory where LIST and DIR are
  109. Xnormally found.  LS can be made resident in your
  110. Xstartup-sequence, but you must set the pure bit on LS after
  111. Xdearchiving to prevent spurious warnings:
  112. X
  113. X    PROTECT C:LS +P
  114. X
  115. XOr you can ignore the pure bit warning in the startup-sequence:
  116. X
  117. X    RESIDENT >NIL: C:LS PURE
  118. X
  119. X
  120. XThe Command Line:
  121. X-----------------
  122. X
  123. X  All arguments are optional.  The default action is to give a
  124. Xshort columnar listing, sorted alphabetically, using the current
  125. Xdirectory.  Alphabetizing is always case insensitive.
  126. X
  127. XYou can group your options together in any order, like this:
  128. X
  129. X    LS -tlr df0:
  130. X
  131. XOr you can have options specified independently:
  132. X
  133. X    LS -t -l -r df0:
  134. X
  135. XHowever, if you specify several file or path names, the options
  136. Xwill return to their default settings between paths.  Thus, you
  137. Xhave a command like this:
  138. X
  139. X    LS -l df0: -r df0:
  140. X
  141. XThis would give you a two listings of df0:, the first one a long
  142. Xlisting, and the second one a reverse sorted short listing.
  143. X
  144. X
  145. XOptions:
  146. X--------
  147. X
  148. X  There are many command options for LS.  You can get a quick
  149. Xreference list of options by typing:
  150. X
  151. X    LS -?
  152. X
  153. XHere is the complete list and description of the options:
  154. X
  155. Xc   Show filenotes, implies long listing.
  156. Xd   Show directory entries only.
  157. Xf   Show file entries only.
  158. Xh   Same as ?, help!
  159. Xk   Do not use ANSI escape codes in output (for colored text).
  160. Xl   Give long listing.
  161. Xn   Do not sort entries before displaying.
  162. Xp   Permit system requests ("Please insert disk xxx in any drive...").
  163. Xr   Reverse sort direction.
  164. Xs   Sort entries by size.
  165. Xt   Sort entries by date.
  166. Xv <pattern> 
  167. X  Do not show entries that match the given pattern.
  168. X
  169. XD   Show directory entries last.
  170. XH   Do not print directory headings or subtotals.
  171. XI   Non-interactive short listings, no "MORE" prompt between pages.
  172. XM   Mix directory and file entries together in final output list.
  173. XP   Print full pathnames for all entries, implies long listing.
  174. XR   Recursive listing, descend into subdirectories that matches pattern.
  175. XT   Print grand total of all entries.
  176. X
  177. X  If LS cannot read the current CLI window size, LS assumes the
  178. Xoutput is 77 columns by 23 rows.  The following two options let
  179. Xyou control the output page width and length of the short
  180. Xcolumnar listing:
  181. X
  182. XX <wide>
  183. X  Set short listing page width to the given number of columns.
  184. XY <high>
  185. X  Set short listing page length to the given number of rows.
  186. X
  187. X  There are two special options that expect a valid directory or
  188. Xfilename after the option:
  189. X
  190. XN <name>
  191. X  Show entries that are newer (more recent than) the given entry name.
  192. XO <name>
  193. X  Show entries that are older (less recent than) the given entry name.
  194. X
  195. X  By using these two options, you can generate a list of files
  196. Xnewer or older than a given file or directory.  For instance,
  197. Xsuppose you had a directory containing C source files for a
  198. Xproject.  Typing "LS -t df0:" produces the following list of
  199. Xfiles sorted by time:
  200. X
  201. X    joe.c  fred.c  pete.c  ted.c  sam.c
  202. X
  203. XNow, if we give the following command:
  204. X
  205. X    LS -N df0:pete.c df0:
  206. X
  207. XThe following files newer than pete.c would be listed:
  208. X
  209. X    ted.c  sam.s
  210. X
  211. XAlso, -N and -O can be used together.  This command:
  212. X
  213. X    LS -N df0:fred.c -O df0:ted.c df0:
  214. X
  215. Xwould produce the only file newer than fred.c and older than ted.c:
  216. X
  217. X    pete.c
  218. X
  219. XTip:  If you need to list files older or newer than a certain
  220. Xdate, rather than a certain file, you can do this:
  221. X
  222. X  echo >RAM:datemark "Marker"    ; Create a temp file in RAM:
  223. X  setdate RAM:datemark 07-Jul-89 ; Set the datestamp for the temp file
  224. X  LS -N ram:datemark df0:        ; List files newer than "datemark"
  225. X  delete ram:datemark            ; Remove the temp file
  226. X
  227. X
  228. XFormatted Output:
  229. X-----------------
  230. X
  231. X  For customized output, there is a special option that expects
  232. Xa format rule as the next "option":
  233. X
  234. XF <format>
  235. X  Format output with <format), with the following special symbols:
  236. X
  237. X    %p   Print the protection bits
  238. X    %d   Print the date, YY-MM-DD
  239. X    %t   Print the time, hh-mm-ss
  240. X    %b   Print the number of filesystem blocks used by this entry.
  241. X    %s   Print the number of bytes used by this entry.
  242. X    %n   Print the name of the entry.
  243. X    %%   Print a percent symbol.
  244. X    \n   Print a linefeed.
  245. X    \t   Print a tab.
  246. X    \\   Print a backslash symbol.
  247. X
  248. XThe default format rule that LS uses for long listings looks like this:
  249. X
  250. X    -F "%p %d %t %4b %8s %n\n"
  251. X
  252. X  Any of the format options that begin with the '%' symbol can
  253. Xhave an optional pad count that lets you specify how many
  254. Xcolumns to use.  For example:
  255. X
  256. X    -F "%40n\n"
  257. X
  258. Xwould print each entry name right justified in a field of 40 columns.
  259. X
  260. X  You can use this feature of LS to help create simple batch
  261. Xcommand files.  For example, look at this command:
  262. X
  263. X    LS -PF "copy %n RAM:\n" df0:*.h
  264. X
  265. X  This tells LS to perform a listing using full pathnames with a
  266. Xspecial format, matching only filenames that end with ".h" in
  267. Xdirectory df0:.  Suppose df0:  has the following files in it:
  268. X
  269. X    joe.h  fred.h  pete.h  ted.h
  270. X
  271. XOur example LS command would result in the following list of commands:
  272. X
  273. X    copy df0:fred.h RAM:
  274. X    copy df0:joe.h RAM:
  275. X    copy df0:pete.h RAM:
  276. X    copy df0:ted.h RAM:
  277. X
  278. XWe could create a script file from this by redirecting the
  279. Xoutput of LS to a temporary file:
  280. X
  281. X    LS >ram:templist -PF "copy %n RAM:\n" df0:*.h
  282. X    EXECUTE ram:templist    ;Do the script
  283. X    DELETE ram:templist     ;Delete it
  284. X
  285. X
  286. XWildcards:
  287. X----------
  288. X
  289. X  Wildcards may be used in file names and in the last level of a
  290. Xdirectory path name.  The UNIX-style '*' character is used to
  291. Xmatch any number of characters, and a '?' matchs any single
  292. Xcharacter.  If you need to specify a pathname with spaces in it
  293. Xlike "Wombat Soup", you need to put quotes around it.  LS can
  294. Xprocess up to 30 separate pathname patterns in per command line.
  295. X
  296. XHere are some simple examples:
  297. X
  298. X    LS df0:*.info      ; List all .info files in df0:
  299. X    LS df0:*/*.info    ; List all dirs and .info files in df0:
  300. X    LS df0:L*/*.info   ; List dirs that start with 'L' and .info files
  301. X
  302. X  Also, wildcards are helpful when you are trying to avoid showing
  303. Xcertain files with the "-v <pattern>" option.  For instance:
  304. X
  305. X    LS -v *.info        ; List current dir, do not show .info files.
  306. X    LS -v *.info df0:   ; Same as above but lists df0: instead.
  307. X    LS -v *.info df0:C* ; List entries that start with the letter "c"
  308. X                        ; in df0:, but do not list .info files.
  309. X
  310. X---------------------------------------------------------------------
  311. X        May all your directory listings be more readable,
  312. X                      Justin V. McCormick
  313. END_OF_FILE
  314. if test 8349 -ne `wc -c <'ls.doc'`; then
  315.     echo shar: \"'ls.doc'\" unpacked with wrong size!
  316. fi
  317. # end of 'ls.doc'
  318. fi
  319. if test -f 'ls.uu' -a "${1}" != "-c" ; then 
  320.   echo shar: Will not clobber existing file \"'ls.uu'\"
  321. else
  322. echo shar: Extracting \"'ls.uu'\" \(13618 characters\)
  323. sed "s/^X//" >'ls.uu' <<'END_OF_FILE'
  324. Xbegin 644 ls
  325. XM```#\P`````````"``````````$```?.```!B0```^D```?.)$@D`$GY````K
  326. XM`$CGP."9_``````@/```#2@B/``!``$L>``$3J[_.DJ`9@``"$S?!P-.=2!`"
  327. XM)$`B0"`\```!=2#<4X!F^B`<9PX@2='<U=`@BB1)4X!@\"A)V?P`````3-\'E
  328. XM`RQX``0I3@78*4\%W"9N`11P`"(\```P`$ZN_LY*JP"L9B1!ZP!<3J[^@$'K@
  329. XM`%Q.KOZ,)`!G``":3J[_?")"3J[^AF```(Q#^@"H<`!.KOW8*4`-)&8$<&1@L
  330. XM7B9K`*S7R]?+)FL`$-?+U\L@`G(`$AO0@5*`3KD``!502H!G1BE`!=0B2R!`:
  331. XM<``0*___3KD``!O2#$(``F4.$/P`("`"(DI.N0``&](@;`743KD``!*X<`!@4
  332. XM!"`O``0O`"!L!=1.N0``%7(B;`TD+'@`!$ZN_F(@/```#2@B3)/\`````"X?7
  333. XM+FP%W"QX``1.KO\N(`=.=61O<RYL:6)R87)Y`"\+(#P```$03KH3YB9`2H!G>
  334. XM#"`+<@S0@2=```A@!@CL`````R`+)E].=4CG,!(F2"!+3KH;R$J`;Q`B+`7X.
  335. XM+&P-)"0+)@!.KO_03-](#$YU3E7__$CG,`(K2/_\("P%^"QL#20B`"0M__QV.
  336. XM`4ZN_]!,WT`,3EU.=2\.+'@`!'``(CP``!``3J[^S@@```QG#$'L!-IAE`CLW
  337. XM`````RQ?3G5.5?_\2.<Q`BX`*T'__"`L"]BPK`8L;U)P`;Z`;TP(+``'``)FQ
  338. XM1$'L!.IA`/]>#*P````;"]AM"$'L!/IA`/],0>P%"F$`_T0@+`7\+&P-)"(`W
  339. XM0>P*'"0(=@%.KO_60>P%$F$`_R9A`/]P(#P``$`!P*P``&8^""P``0`#9PA!V
  340. XM[`4<80#_!B\M__PO!TAL!2A(;`H<3KH2\$'L"AQA`/[L0>P#KF$``#9![`/8@
  341. XM80#^W$_O`!!,WT",3EU.=4CG`Q`F2"X`?`!@!"934H:\AVP$2I-F]"`+3-\(%
  342. XMP$YU3E7__"M(__P(+``!``-G""!M__QA`/Z83EU.=4Y5_[Q(YR\P*TC_P$'LN
  343. XM`[)ATD'M_^1#[?_@3KH2GDJL"]AF!BEM_^0+V$JL"]1F!BEM_^`+U'P`?@`@0
  344. XM;?_`)E!@,B!K``@@*``$2H!O%@@L``$``V8.0^@`""!)0^P#ITZZ&A(@:P`(*
  345. XM4(A.NAGXWH!2AB932I-FRBM&_]P@!R]``!P@!R(&3KH:C"X`("\`'"(&3KH:+
  346. XM@$J!9P)2AR`L"]BPK`8L;@1X`6`:>``K0/_D8`H@!U2`D:W_Y%*$("W_Y+"'X
  347. XM;.YP8W(`0>P&-!#!4<C__"PM_]P@!B($3KH:."H`(`8B!$ZZ&BY*@6<"4H5^4
  348. XM`"!M_\`D4&!L0JW_Y"9*8#0@:P`(4(A.NAE<(&W_Y'(`0^P&-"0($C$H`+"!=
  349. XM;PA#[`8T$X`H`%*M_^0@!2!+80#^E"9`("W_Y+"$;`1*DV;`2H=F'"@M_^0@H
  350. XM!B($3KH9QBH`(`8B!$ZZ&;Q*@6<"4H52AR12OH5L!$J29HPK1?_4?`!"K?_D2
  351. XM8`QP`!`35(#<@"M'_^1![`8T("W_Y-'`)D@N`%*'OH1MX'``$!,N!MZ`<`&X^
  352. XM@&\,OJP+V&\&4X1@`/\4("P+U%>`2.T``?_0;@9R`2M!_]!P`2PM_]0K0/_,#
  353. XM(`8B+?_03KH9/"H`(`8B+?_03KH9,$J!9P)2A2M%_]A^`"MM_]#_X"!M_\`FH
  354. XM4&```4)P`;J`;S0@+?_@L*W_T&8J<``K0/_@""P``0`#9Q0@+?_,(@5A`/S@2
  355. XM""P````#9@`!*BHM_]A2K?_,0JW_Y"1M_\1@``#.(&H`""`H``1*@&H80^@`I
  356. XM"$'L"AQ.NA@F0>P*'$ZZ%_XJ`&!.0BP*'"!J``A0B$ZZ%^PJ``@L``$``V<,'
  357. XM0>P*'$/L`[M.NA?F(&H`"%"(+T@`'$'L"APB;P`<3KH7T`@L``$``V<,0>P*3
  358. XM'$/L`ZY.NA>\(`8@2F$`_00D0"`M_^0B`%*!LH1L-$J29S!R`$'L!C02,`@`^
  359. XM+@%2AT'L"AQ.NA=\+`!@"!:\`"!3AU*&0>P*'-'&)DB^A6SL0A-![`H<80#[E
  360. XMB%*M_^0J+?_8+"W_U"`M_^2PA&P&2I)F`/\D0>P#V&$`^XQA`/NP+BW_R%*'V
  361. XM4JW_X"!M_\0F4"M+_\0K1__(""P````#9@J^AFP&2I-F`/ZH0>P#MV$`_(),N
  362. XMWPST3EU.=4Y5__Q(YP`P)D@D24*28!QP`!`;+T``""`2<@I.NA=J(B\`"-"!H
  363. XM<C"0@22`$!-R,+`!909R.;`!8]8@"TS?#`!.74YU3E7_W$CG(3(K2/_H(&P+.
  364. XMW$ZZ%J(N`"!L"]PB2-/')DDB2R])`!AP`;Z`;QAP.K`K__]G$!:\`"\@;`O<1
  365. XM+$C=QT(N``$@;`O<3KH6:B!L"]S1P"9()&W_Z"](`!0@*@`$2H!O%`@L``$`)
  366. XM`V<,($M#[`.[3KH68"9`0>H`""](`!P@2R)O`!Q.NA9,)D`@*@`$2H!O$@@LM
  367. XM``$``V<*($M#[`.N3KH6,$7L"APF;`368``!&!`3<B6P`6<,=%RP`F<&%,!@+
  368. XM``$"4HNP`68``-(@2T/M_^QA`/[F)D`K2__P#*T```!C_^QO!G!C*T#_['``T
  369. XM$!,$0``E9W`$0``]9RI50&<:!$``"F<L54!G"E=`9QY30&<.8%Y'[`NH8%Q']
  370. XM[`N<8%9'[`O(8%!'[`N(8$I'[`NT8$0@;?_H("@`!$J`;Q0(+``!``-G#"`M*
  371. XM_^Q*@&\$7JW_[`@L``,``F<&)FP+W&`6)F\`%&`0($H0O``E5(I"*``!1^P#F
  372. XMV2!+3KH5."X`8`84_``@4H>^K?_L;?0@2B)+3KH50"1`)FW_\&`H<``0$P1`F
  373. XM`%QG&`1``!)G!EU`9PA@$!3\``I@"A3\``E@!!3\`%Q"$E*+2A-F`/[F0>P*6
  374. XM'&$`^0X(+``'``-G."9M_^A**P"09RY![`.[80#Z1D'K`)`O"$AL!3I(;`H<!
  375. XM3KH,WD'L"AQA`/C:0>P#KF$`^B1/[P`,(&\`&$(03-],A$Y=3G5(YR,0)DA^/
  376. XM`$8'SJL`=$'L"ZA#[`5$3KH4F'P#8"YP`2(`[:'"AV<*0>P+L)'&<BT0@2(&%
  377. XM6($D`..B(@?"@F8*0>P+K)'&$+P`+5.&2H9JSDHK`)!F!AE\`"T+J$'K`(1(2
  378. XM;`O(0^P+G$ZZ#RI83R`K``1*@&\:0>P+B$/L!4Y.NA0P0>P+M$/L!5!.NA0D=
  379. XM8"0O*P"`2&P#9TAL"XA.N@P<+JL`?$AL`V=(;`NT3KH,#$_O`!0@2V$`_21,$
  380. XMWPC$3G4O"R9(0>P#LF$`^49P`"E`!B@I0`8D)E-@,F$`^#`(+`````-F9B!K4
  381. XM``AA`/\4(&L`""`H``1*@&H0("@`@-&L!B0@*`!\T:P&*"932I-FRB`\``!`?
  382. XM`<"L``!F*"\L!B@O+`8D+RP&("\L!AQ(;`-K2&P*'$ZZ"X1![`H<80#W@$_O#
  383. XM`!A![`.W80#XQB9?3G4O"R9(""P``P`!9Q)![`7L(DM.NA"B2H!K!'``8!P(Q
  384. XM+``"``%G$B!+0^P%X$ZZ$(A*@&L$<`!@`G`!)E].=4CG`!(F2"`+9QY@$"QX^
  385. XM``0@2TZN_O@@0$ZZ"OX@4TJ09NH@2TZZ"O),WT@`3G5.5?_@2.<G,B9)*TC_^
  386. XM['``*4`&("E`!APN`"E`!BQP#$ZZ"J8O0``D2H!F!G``8``!>"!O`"1.NA1H\
  387. XM<`Q.N@J*+T``($J`9P`!3B!`3KH44F$`]OX(+`````-F``$L("W_["QL#20BW
  388. XM`"0+3J[_E"P`2H9G``#"4H=!ZP"$80#_%DJ`9P``LB`K``1*@&\&1>P'Q&`$S
  389. XM1>P(\$'K``@O2``<(DI.N@XT*@`(+``$``)G%DJ%9Q(@;P`<(FP+X$ZZ#AHJ-
  390. XM``I%``%*A6=L("L`!$J`;R(@;P`@(DM.N@_*2H!G``"V""P``@`#9TQ2K`8<,
  391. XM4JP&#&`@""P``P`#9SI2K`8@4JP&$"`K`(#1K`84("L`?-&L!A@@;P`<3KH1K
  392. XMNBH`NJP&+&\$*44&+"!O`"0B2TZZ#W1*@&=@2H9F`/\6("P&'-"L!B!F(`@L@
  393. XM``8``F8Z2H=F"D'L!&=A`/6J8"Q![`2&80#UH&`B<`S`K```9QH(+``%``-F'
  394. XM"B!O`"1A`/;T8`@@;P`D80#]?B!O`"1A`/Y$("\`(&`2(&\`)&$`_C8@;P`@M
  395. XM80#^+G``3-],Y$Y=3G5.5?_L2.<@,B9(*TG_^"`++&P-)"(`)"P&!$ZN_YI*]
  396. XM@&8>3J[_?"\`2&P$!4AL"AQ.N@D<0>P*'&$`]1A@``&0)&W_^$H29T8(+``$I
  397. XM``-G/@@L``8``F8V""P``0`#9Q0O"DAL!51(;`H<3KH(XD_O``Q@$B\*2&P%S
  398. XM9$AL"AQ.N@C.3^\`#$'L"AQA`/3&(&P&!"`H``1*@&H@""P``P`#9P`!+$'L%
  399. XM!I@B2$ZZ#H0@;`8$80#[X&```18@2R)L!@1A`/V.+T``%$J`9P`!`@@L``0`)
  400. XM`V<``/`@0"908```XF$`]+X(+`````-F``#:(&L`""`H``1*@&\``,0@;?_X<
  401. XM3KH0(B!K``A0B"]``!!.NA`4(B\`$-*`<"32@"`!3KH'^"1`2H!G``"6(&W_(
  402. XM^$H09S(@2B)M__A.NA`*(&W_^$ZZ#^)3@"!M__@2,`@`=#JR`F<0="^R`F<*\
  403. XM($I#[`.G3KH/TB!K``A0B"](`!@@2B)O`!A.N@^^+&P-)"(*=/Y.KO^L+T``+
  404. XM$$J`9RP(+``&``)F"$'L`]AA`//>*4H+W"!O`!`B2F$`_E@@+P`0+&P-)"(`W
  405. XM3J[_IB!*3KH'?B932I-F`/\<(&\`%&$`_%9,[4P$_]Q.74YU3E7_[$CG`#!(,
  406. XM[0,`__`F;?_P(&W_]$*08```A%*+$!-R(+`!9_9R";`!9_!R"K`!9^I*$V=VR
  407. XM(&W_]"`0(@#E@2!M``C1P21((&W_]%*0<"*P$V8F($M2BR2++T@`"&`"4HM*-
  408. XM$V<&<"*P$V;T2A-F!B2O``A@-D(;8"0DBV`"4HM*$V<4$!-R(+`!9PQR";`!5
  409. XM9P9R"K`!9N9*$V<00AL@;?_T#)`````@;0#_=$S?#`!.74YU3E7_]$CG(3(F6
  410. XM2"M)__1^`"`\```!!$ZZ!G0D0$J`9T(L;`TD(@MT_DZN_ZPF0"`+9RH@"R(`E
  411. XM)`I.KO^:2H!G$$/J`(0L;?_T+-DLV2S9?@$@"RQL#20B`$ZN_Z8@2DZZ!DX@L
  412. XM!TS?3(1.74YU3E7^T$CG`1(F2"X!*T#^T$JL!@!G%`@L`````F<,(BP&`"QL%
  413. XM#21.KO^F(&P&!$ZZ!A)*$V<<+P<O"TAL`_%(;?[43KH&$D'M_M1A`/(.3^\`&
  414. XM$"QX``23R4ZN_MH@0"%L!@@`N"%'`)0@+?[03KH-^DS?2(!.74YU+PM'[`22E
  415. XM8`@@4V$`\=98BTJ39O1P%')X0>P#V6$`_VHF7TYU3E7_X$CG#Q(N`29(+``JK
  416. XM!E*%>`$B!N6!*T#_["]!`"`@<Q@`3KH-:B]``!Q@``*L(&\`("`((G,(`-/$8
  417. XM<``0$01``#]G``"66T!G``"854!G``"<54!G``"X4T!G``"\64!G``#`4T!GG
  418. XM``#$4T!G``#^4T!G``$X54!G``$^54!G``%"64!G``%&4T!G``%F!$``"F<`&
  419. XM`8130&<``8I50&<``8Y50&<T5T!G``&.4T!G``&254!G``&654!G``&:54!G%
  420. XM``&H4T!G``&J4T!G``&L54!G``&N8``!RF$`_OY@``'V".P````!8``!["P%R
  421. XM4H:^AFP$80#^Y"`%Y8`I<P@`!-8J!@CL``4``V```<H([``&``)@``'`".P`_
  422. XM!P`"8``!M@CL``$``6```:PL!5*&OH9L"&$`_J1@``&<(`7E@"]``!@@<P@`0
  423. XM0^P%[&$`_:A*@&8,("\`&"!S"`!.N@OB*@8([``#``%@``%L+`52AKZ&;`AAP
  424. XM`/YD8``!7"`%Y8`O0``8(',(`$/L!>!A`/UH2H!F#"`O`!@@<P@`3KH+HBH&(
  425. XM".P``@`!8``!+`"L```((```8``!(`CL``0``V```18([``%``)@``$,+`52V
  426. XMAKZ&;`AA`/X$8```_"`%Y8`@<P@`0^P+V&$`]*PJ!F```.8L!5*&OH9L"&$`-
  427. XM_=Y@``#6(`7E@"!S"`!#[`O480#TABH&8```P'!0T("!K```8```M`BL``,`W
  428. XM`V```*H(K``"``-@``"@"*P``0`#8```E@CL``4``V```(P([``&``-@``""[
  429. XM+'@`!)/)3J[^VB!`(6P&"`"X8&P([``!``)@9'`!*4`&,&!<<`(I0`8P8%0L/
  430. XM!5*&OH9L!&$`_4X@!>6`*7,(``O@*@8([``$``)@-"!O`"`@"")S"`#3Q!M1+
  431. XM__!"+?_Q2&W_\$AL`]Q(;`H<3KH"]$'L"AQA`.[P80#]"D_O``Q2A+BO`!QMG
  432. XM`/U0(`5,WTCP3EU.=4Y5_VQ(YR$R*TC_<"QX``23R4ZN_MHF0"EK`+@&"'#_\
  433. XM)T``N$AM_W@@;?]P0^W_=&$`^R983RQL#21.KO_**4`%_$ZN_\0I0`7X(@!.@
  434. XMKO\H2H!G%"`L!?PB`$ZN_RA*@&<&".P``0`#(#P```$$3KH"*"E`!@1F!$ZZ3
  435. XM"<Q^`7``*4`&$"E`!@PI0`88*4`&%+ZM_W1L4"`'Y8!![?]XT<`B4'`ML!%F:
  436. XM/G`"P*P```!```PI0```0>P#/RE(!-8@!R(M_W1![?]X80#\2BX`OJW_=&P2*
  437. XM(`?E@$'M_WC1P")0<"VP$6?8OJW_=&P``+@([`````)P`!E`"/`90`?$(`?EZ
  438. XM@$'M_WC1P"](`!1![`:8)&\`%")23KH)K%*'0>P&F$ZZ!7!*@&=$0>P(\$/L.
  439. XM!IA.N@>\0>P'Q$/L"/!.N@F&0>P&F")(3KH':$'L!IA.N@5"2H!G%D'L!\1#G
  440. XM[`:83KH'CD'L!I@B2$ZZ!T9![`:83KH%($J`9PQP%')X0>P$26$`^O8L;`TDH
  441. XM0>P&F"((=/Y.KO^L*4`&`&800>P&F$ZZ"+9@!BEK`)@&`'`Z0>P&F$ZZ!XY*X
  442. XM@&8,(&P&`$/L!IA.N@>00>P&F"E("]P0+`?$2@!F#'`J&4`'Q'(`&4$'Q1`LH
  443. XM"/!*`&8*&7P`*@CP0BP(\2!L!@!#[`:880#WA$JL!@!G%@@L`````F<.("P&!
  444. XM`"QL#20B`$ZN_Z9"K`8`80#M``@L``4``F=(0>P#P&$`[?1![`.<80#LFD'L*
  445. XM`\IA`.WD+RP&&"\L!A0O+`80+RP&#$AL`VM(;`H<3KH`<D'L"AQA`.QN0>P#_
  446. XMKF$`[;A/[P`8OJW_=&P*""P````#9P#^$'``(@!![`/980#Y[$S?3(1.74YU4
  447. XM``!(YR`"6(`D`'(`+'@`!$ZN_SI*@&<&+$`LPB`.3-]`!$YU+PY#Z/_\(!$L-
  448. XM>``$3J[_+BQ?3G5.50``2.?@\B!M``Q#[0`01?H`%B9M``@L>``$3J[]]DS?B
  449. XM3P=.74YU%L!.=4Y5_]1(YS@B*TC_^"M)__PL;`TD3J[_RB(`3J[_*$J`9R9.M
  450. XMKO_$(@!.KO\H2H!G&)/)+'@`!$ZN_MH@0"MH`*3_]$JM__1F"'(7=$U@``$X<
  451. XM>`!P`"!`3KH!EBM`_^QG``$R<$1.NO\X*T#_\&<``'XD;?_L(D`@;?_T<`%.F
  452. XMN@$<+&P-)$ZN_\0B`'8$0>P#U"0(+&P-)$ZN_]`,@`````1F```L)#P``"<0X
  453. XM3J[_RB(`3J[_-$J`9P``%DZN_\HB`'800>W_V"0(3J[_UB@`)&W_[")M__`@.
  454. XM;?_T<`!.N@"\("W_\&<&($!.NO[6("W_[&<``*!.N@%^#(0````);P``DD7M+
  455. XM_]@,*@`[``1F``"$##(`<D#_9@``>EI*<@`2&@1!`#`,$@`[9QK"_``*TAH$.
  456. XM`0`P#!(`.V<*POP`"M(:!`$`,%)*=``4&@P"`"!G``!"#`(`.V<``#H,`@!RC
  457. XM9P``,@0"`#`,$@`@9QK$_``*U!H$`@`P#!(`(&<*Q/P`"M02!`(`,"!M__P@Y
  458. XM@2!M__@@@DS?1!Q.74YU2.<`-B9(*DE![0`4*T@`"B!-*T@`%"M*`!@K?```-
  459. XM`^(`'$I`9P``#"M\_____P`H8`1"K0`H($LB32QX``1.KOZ2($I.KOZ`($I.N
  460. XMKOZ,3-]L`$YU2.<%)BI(*@!P_RQX``1.KOZV#(#_____9@9P`&```&(N`'`BU
  461. XM3KK]BDJ`9@P@!TZN_K!P`&```$HD0"5-``H510`)%7P`!``(%7P````.%4<`1
  462. XM#Y/)3J[^VB5``!"[_`````!G"B)*3J[^GB`*8!)!Z@`4((A8D$*H``0A2``(J
  463. XM(`I,WV2@3G5(YP`&*D`L>``$2JT`"F<&(D!.KOZ8&WP`_P`(*WS_____`!1P*
  464. XM`!`M``].KOZP($U.NOT:3-]@`$YU3E4``$CG'S(F22)(?DXJ$6T``+R*_`6U\
  465. XM(`5(Q>6-WH5(0#H`2D5G&#P\`6TP!P)```-F`E)&ND9M!II&4H=@Y'@`?`!2O
  466. XM14'L`S,<,$``#$0``68*,`<"0``#9@)21KI&;PJ:1E)$#$0`#&W>#(<```!C]
  467. XM;P@$AP```&1@\"`I``B`_``R2,`O`"`I``0B`(#\`#QV`#8`P/P`/))`+P$OH
  468. XM`TAL`R$O+0`(3KK\?$_O`!0O!5)$+P0O!TAL`P\O"TZZ_&9/[P`43-],^$Y=:
  469. XM3G5#[`,&(&T`"$ZY```=?$/L`OT@2TZY```=?&#<<``0&&<.#```*F<&#```A
  470. XM/V;P<`%.=4Y5_\!(YQ`P)$@F24'M_\!#[?_$=@!*$F8&2A-G``"8#!,`*F9"@
  471. XM#$,`0&<``(XABS``(XHP`%!#4DM@VE%#(`A*0VT,('$X`$H09@110V#P2D-M4
  472. XM9B!`)G`P`%)+4K$P`"1Q.`!00V"N#!,`/V8*2A)F-$I#9T1@Q!`2#```0&,*%
  473. XM#```6F($!@``(!(3#`$`0&,*#`$`6F($!@$`(+(`9P9*0V<68)9*$F<"4DI*/
  474. XM$V<&4DM@`/]B<`%@`G``3-\,"$Y=3G5(YS`@)``F+```"`,`$68B("@`!+"I,
  475. XM``1M!F<6<`!@`G`!"`,`$&<``(`(0```8```>`@#``9F``!D2D)F-E"(4(E*7
  476. XM$&<H$AD,`0!`8PH,`0!:8@0&`0`@$!@,``!`8PH,``!:8@0&```@L@!GU)`!)
  477. XM;B9@*%-"9@X@*`!\L*D`?&X6;1A@N$'H`(1#Z0"$3KH`'DJ`9ZAM!'`!8`)PO
  478. XM``@#``EG!`A```!,WP0,3G4@$)"19A0@*``$D*D`!,'\"[C0J``(D*D`"$YU=
  479. XM2.<@-B0L!C`F2"1)*E-*E6<6(FH`""!M``@@`DZZ_QA*0&8$*E5@YB!+(DHD=
  480. XM;0`$+'@`!$ZN_Q9,WVP$3G5(YP`V)$@F24ZY```!8$J`9R`J0"`\```!!")M;
  481. XM``@@2RQX``1.KOV0(DT@2DZZ_Y1P`4S?;`!.=7``3G4O"G``)$E*&6;\$B$,P
  482. XM`0`Z9QP,`0`O9A"SRF<2#"D`+___9PI326`&L\IBWF`*L\IE!A#:4D!@]D(0N
  483. XM)%].=2\*<``D24H99OP2(0P!`#IG#`P!`"]G!K/*8NY@`E))$-EG!%)`8/@DC
  484. XM7TYU4X!M!!#99OA"$"`(3G6SR&4,T,#2P!,@4T!N^F`&$MA30&[Z3G6P$&<*E
  485. XM2AAG`F#V<`!.=2`(3G5(YSTR)@@D24(2>@`@/````01.NODR+@!G``"*+&P->
  486. XM)$J#9T@B`R0'3J[_FDJ`9W0B1PPI`"``"&482A)G"D/L`Z<@2DZZ`'@B1U")_
  487. XM($I.N@!N*`,B`TZN_RXF`$I%9@1Z`6"\(@1.KO^F8+0B1PPI`"``"&0,0^P#2
  488. XMJ2!*3KH`0&`H<"\@2DZZ_V9*@&<(($`0O``Z8!1#[`.E($I.N0``'6Q@!D(2W
  489. XM=@!@`G8!2H=G!B!'3KKXM"`#3-],O$YU2.<!,"9))$@@2TZY```=7"X`($I.-
  490. XMN0``'5Q20")*TL<@2DZZ_O0P!R)*($M.NO[J3-\,@$YU<F=P%$'L!$).N0``\
  491. XM#S!.=4CG.`(D""QL#21.KO]\)@`@/````2Q.NO@J*`!F!DZZ_]!@(B\"2&P$&
  492. XM,R\$3KKX2D_O``PB`W`4($1.N0``#S`@1$ZZ^"!,WT`<3G4``"`(2AAF_%-(B
  493. XMD<`@"$YU```@"$H89OQ3B!#99OQ.=0``2.<`,"9()$D0&A:`2@!G!%*+8/0@1
  494. XM"TS?#`!.=4CG`Q`N`$?L!6P@"V<P""L``@`;9B0(*P`!`!MG'"`K``20JP`0A
  495. XM+`!*AF<.("L`'"(&(&L`$$ZZ_90F4V#,(`=.N@#V3-\(P$YU``````````!PD
  496. XM84CG,``D`"8!2$)(0\3!QL#`P=1#2$)"0M""3-\`#$YU2H!J```>1(!*@6H`H
  497. XM``Q$@6$``"!$@4YU80``&$2`1(%.=4J!:@``#$2!80``!D2`3G4O`DA!-`%FH
  498. XM```B2$!(04A"-`!G```&A,$P`DA`-`"$P3`"2$(R`B0?3G4O`W80#$$`@&0`U
  499. XM``;AF5%##$$(`&0```;IF5E##$$@`&0```;EF55#2D%K```&XYE30S0`YJA(V
  500. XM0D)"YJI(0X#!-@`P`C0#2$'$P9""9```"%-#T(%D_G(`,@-(0^>X2$#!028?V
  501. XM)!].=4CG!P`N`"`L!6A3@"P`2D9K+B`&2,#G@$'L"^0J,`@`2@5G&`@%``)FA
  502. XM$B`&2,#G@$'L"^0@,`@$3KK\6E-&8,X@!TZZX@A,WP#@3G4`````````````K
  503. XM```@B%B00J@`!"%(``A.=0`````#[`````T````````;-@``'0@``!U*```9D
  504. XM.```&40``!S4```<W@``'*@```#:```!$````/(```$&```!)`````$````!.
  505. XM````!@````````/R```#Z@```8D````,FS,S;4Q3(#,N,9LP;2!01"!&<F5E+
  506. XM=V%R92!B>2!*=7-T:6X@5BX@36-#;W)M:6-K(#@Y+3`W+3(Y``H@(%5S86=E_
  507. XM.B!,4R!;+6]P=&EO;G,@/&%R9W,^72!;<&%T:#%=(%MP871H,ET@+BXN"@`)[
  508. XM8R`@4VAO=R!F:6QE;F]T97,@("`@("`@("`@($0@(%-H;W<@9&ER<R!L87-T8
  509. XM"@`)9"`@1&ER<R!O;FQY("`@("`@("`@("`@("`@($@@($YO(&AE861I;F=S3
  510. XM(&%N9"!S=6)T;W1A;',*``EF("!&:6QE<R!O;FQY("`@("`@("`@("`@("`@"
  511. XM22`@3F\@<&%G92!P<F]M<'1S"@`):R`@3F\@04Y322!D:7-P;&%Y(&-O9&5S"
  512. XM("`@($T@($UI>&5D(&]U='!U="!F:6QE<R!A;F0@9&ER<PH`"6P@($QO;F<@<
  513. XM;&ES=&EN9R`@("`@("`@("`@("!.(#QN86UE/B!3:&]W(&YE=V5R('1H86X@0
  514. XM96YT<GD*``EN("!.;R!S;W)T("`@("`@("`@("`@("`@("`@3R`\;F%M93X@"
  515. XM4VAO=R!O;&1E<B!T:&%N(&5N=')Y"@`)<"`@4&5R;6ET('-Y<W1E;2!R97%U*
  516. XM97-T<R`@(%`@(%-H;W<@9G5L;"!P871H;F%M97,*``ER("!2979E<G-E('-OG
  517. XM<G0@("`@("`@("`@("`@4B`@4F5C=7)S:79E(&QI<W1I;F<*``ES("!3;W)T8
  518. XM(&)Y('-I>F4@("`@("`@("`@("`@5"`@5&]T86P@86QL('-U8G1O=&%L<PH`R
  519. XM"70@(%-O<G0@8GD@9&%T92`@("`@("`@("`@("!8(#QW:61E/B!3970@;W5T=
  520. XM<'5T(&-O;'5M;G,*``EV(#QP871T97)N/B!!=F]I9"!P871T97)N("`@62`\A
  521. XM:&EG:#X@4V5T(&]U='!U="!R;W=S"@`)1B`\9F]R;6%T/B!&;W)M870@;W5TC
  522. XM<'5T("AD969A=6QT.B`B`"(I"@`P,"TP,"TP,``P,#HP,#HP,``E,#)L9"TE.
  523. XM,#)L9"TE,#)L9``E,#)L9#HE,#)L9#HE,#)L9``?'!\>'QX?'QX?'A\E<"`EV
  524. XM9"`E="`E-&(@)3AS("5N7&X`````````````````````````)6QD`$1I<G,ZF
  525. XM)2TT;&0@1FEL97,Z)2TT;&0@0FQO8VMS.B4M-6QD($)Y=&5S.B4M.&QD"@!4A
  526. XM;W1A;',Z"@`Z`"\`4D%-.@";,&T`FS`@<`";('``FS,S;0";,3LS,SLT,&T`/
  527. XMFS$[,S$[-#!M`)LP('$*````56YK;F]W;B!O<'1I;VXZ("TE<PH`3%,Z("5S`
  528. XM+"!%<G)O<B`C)6QD"@!#86YN;W0@97AA;6EN92!F:6QE(&]R(&1I<F5C=&]R_
  529. XM>2P@17)R;W(@(R5L9`H`)R5S)R!N;W0@9F]U;F0`3F\@4D%-`%5N86)L92!T,
  530. XM;R!P871T97)N(&UA=&-H('!A=&AS`%9O;'5M92!O<B!D:7)E8W1O<GD@:7,@$
  531. XM96UP='DN"@!.;R!M871C:"X*```````$````/@```'(```"B````W0```0X`+
  532. XM``%+```!B````<4```'Z```"+0```F(```*<```"TP```S\```+Y````````9
  533. XM`S^;,&V;('`J*D)214%+"@``FS=M("TM($U/4D4@+2T@`%!R97-S(%)E='5R-
  534. XM;CH@``";,&V;('```)LP('";1IM+``";,"!PFS0[,S-M``!086=E("5L9"!OF
  535. XM9B`E;&0Z```O*B`E<R`J+PH`8VAS<&%R=V5D`#``1&ER`)LS,#LT,6T@)7,@\
  536. XMFS!M"@`E<PH`````*```!8X`````````````````````````````````````?
  537. XM``````6P````````````````````````````````````````````````````U
  538. XM````````````````````````````````````````$P``!-8```3.```$R@``-
  539. XM!,8```3"```$O@``!+H```2V```$L@``!*X```2J```$I@``!*(```2>```$6
  540. X=F@``!)8```22```%C@``!6P```/L`````````_*J<
  541. X``
  542. Xend
  543. Xsize 9704
  544. END_OF_FILE
  545. if test 13618 -ne `wc -c <'ls.uu'`; then
  546.     echo shar: \"'ls.uu'\" unpacked with wrong size!
  547. fi
  548. # end of 'ls.uu'
  549. fi
  550. if test ! -d 'src' ; then
  551.     echo shar: Creating directory \"'src'\"
  552.     mkdir 'src'
  553. fi
  554. if test -f 'src/Makefile' -a "${1}" != "-c" ; then 
  555.   echo shar: Will not clobber existing file \"'src/Makefile'\"
  556. else
  557. echo shar: Extracting \"'src/Makefile'\" \(321 characters\)
  558. sed "s/^X//" >'src/Makefile' <<'END_OF_FILE'
  559. X# -------------------------------------------------
  560. X# LS 2.3 makefile by Justin V. McCormick 89-07-05
  561. X# -------------------------------------------------
  562. XCFLAGS = -cfmtu -d1 -m0 -rr -v -O
  563. XAFLAGS = -iainc: -cvy
  564. X
  565. XOBJS = mycres.o ls.o lssup.o
  566. XDEST = lcs
  567. X$(DEST): $(OBJS)
  568. X    BLINK WITH linkfile
  569. X    @beep 300 2
  570. X
  571. Xls.c: WORK:ls.h
  572. END_OF_FILE
  573. if test 321 -ne `wc -c <'src/Makefile'`; then
  574.     echo shar: \"'src/Makefile'\" unpacked with wrong size!
  575. fi
  576. # end of 'src/Makefile'
  577. fi
  578. if test -f 'src/README' -a "${1}" != "-c" ; then 
  579.   echo shar: Will not clobber existing file \"'src/README'\"
  580. else
  581. echo shar: Extracting \"'src/README'\" \(677 characters\)
  582. sed "s/^X//" >'src/README' <<'END_OF_FILE'
  583. X  I have included the object files "lssup.o" and "mycres.o" preassembled
  584. Xusing CAPE 2.5.  You can assemble these files using ASM, but the final
  585. Xexecutable will grow by about 200 bytes!
  586. X
  587. X  The makefile is designed to work with either LMK or PDMake,
  588. Xand assumes that you are using CAPE as your assembler.  You
  589. Xshould change the AFLAGS line in order to use a different
  590. Xassembler.  Also, my assembly header file directory is
  591. Xreferenced by the assignment "AINC:"; you should either make
  592. Xthis assignment on your system or modify the makefile to specify
  593. Xa different directory.  The module "mycres.a" will need the
  594. Xstandard assembly headers to assemble.
  595. X
  596. X     Good Luck,
  597. X       Justin
  598. END_OF_FILE
  599. if test 677 -ne `wc -c <'src/README'`; then
  600.     echo shar: \"'src/README'\" unpacked with wrong size!
  601. fi
  602. # end of 'src/README'
  603. fi
  604. if test -f 'src/linkfile' -a "${1}" != "-c" ; then 
  605.   echo shar: Will not clobber existing file \"'src/linkfile'\"
  606. else
  607. echo shar: Extracting \"'src/linkfile'\" \(405 characters\)
  608. sed "s/^X//" >'src/linkfile' <<'END_OF_FILE'
  609. X;Link with file for LS by Justin V. McCormick 89-07-25
  610. X;Stubs out lots of unused things that Lattice 5.0 dragged in
  611. XDEFINE @write=@nullstub
  612. XDEFINE @_dwrite=@nullstub
  613. XDEFINE @_dseek=@nullstub
  614. XDEFINE @_dclose=@nullstub
  615. XDEFINE @CXBRK=@nullstub
  616. XFROM
  617. X;lat:lib/cres.o
  618. Xmycres.o
  619. Xls.o
  620. Xlssup.o
  621. XTO LCS
  622. XLIB lib:lcr.lib lib:amiga.lib
  623. XSC SD
  624. XND
  625. X;ADDSYM
  626. X;VERBOSE
  627. X;MAP link.map F H L S X PLAIN WIDTH 84 HEIGHT 0 SWIDTH 20
  628. END_OF_FILE
  629. if test 405 -ne `wc -c <'src/linkfile'`; then
  630.     echo shar: \"'src/linkfile'\" unpacked with wrong size!
  631. fi
  632. # end of 'src/linkfile'
  633. fi
  634. if test -f 'src/ls.h' -a "${1}" != "-c" ; then 
  635.   echo shar: Will not clobber existing file \"'src/ls.h'\"
  636. else
  637. echo shar: Extracting \"'src/ls.h'\" \(1391 characters\)
  638. sed "s/^X//" >'src/ls.h' <<'END_OF_FILE'
  639. X/* Prevent Lint from complaining about ANSI prototype extensions */
  640. X#ifdef _lint
  641. X
  642. X#define __asm
  643. X#define __stdargs
  644. X#define __regargs
  645. X#define R_D0
  646. X#define R_D1
  647. X#define R_A0
  648. X
  649. X#else
  650. X
  651. X#define R_D0    register __d0
  652. X#define R_D1    register __d1
  653. X#define R_A0    register __a0
  654. X
  655. X#endif
  656. X
  657. X#include <dos.h>
  658. X#include <libraries/dosextens.h>
  659. X
  660. X/*lint -save    */
  661. X/*lint -library */
  662. X#include <stdio.h>
  663. X#include <string.h>
  664. X#include <stdlib.h>
  665. X#include <signal.h>
  666. X#include <proto/exec.h>
  667. X#include <proto/dos.h>
  668. X/*lint -restore    */
  669. X
  670. Xextern int tolower (char);
  671. X
  672. X#define MEMF_PUBLIC (1L<<0)
  673. X#define MEMF_CHIP   (1L<<1)
  674. X#define MEMF_FAST   (1L<<2)
  675. X#define MEMF_CLEAR  (1L<<16)
  676. X
  677. X/* Structure used to hold file info in a linked list */
  678. Xstruct FibEntry
  679. X{
  680. X  struct MinNode fe_Node;
  681. X  struct FileInfoBlock *fe_Fib;
  682. X};
  683. X
  684. X/* Flag bits for LSFLAGS */
  685. X#define BREAKFLAG    (1L << 0)
  686. X#define CONSOLE        (1L << 1)
  687. X#define SHOWDIRS    (1L << 2)
  688. X#define SHOWFILES    (1L << 3)
  689. X#define LISTALL        (1L << 4)
  690. X#define LONGLIST    (1L << 5)
  691. X#define NOSORTFLAG    (1L << 6)
  692. X#define NOTEFLAG    (1L << 7)
  693. X#define PATHNAMED    (1L << 8)
  694. X#define REVFLAG        (1L << 9)
  695. X#define LSUNUSEDFLAG    (1L << 10)
  696. X#define FULLPATHNAMES    (1L << 11)
  697. X#define ANTIMATCH    (1L << 12)
  698. X#define TOTALIZE    (1L << 13)
  699. X#define NOHEADERS    (1L << 14)
  700. X#define NOINTERACT    (1L << 15)
  701. X#define FILESFIRST    (1L << 16)
  702. X#define MIXFILESDIRS    (1L << 17)
  703. X#define SHOWOLDERTHAN    (1L << 18)
  704. X#define SHOWNEWERTHAN    (1L << 19)
  705. END_OF_FILE
  706. if test 1391 -ne `wc -c <'src/ls.h'`; then
  707.     echo shar: \"'src/ls.h'\" unpacked with wrong size!
  708. fi
  709. # end of 'src/ls.h'
  710. fi
  711. if test -f 'src/lssup.o.uu' -a "${1}" != "-c" ; then 
  712.   echo shar: Will not clobber existing file \"'src/lssup.o.uu'\"
  713. else
  714. echo shar: Extracting \"'src/lssup.o.uu'\" \(7291 characters\)
  715. sed "s/^X//" >'src/lssup.o.uu' <<'END_OF_FILE'
  716. Xbegin 644 lssup.o
  717. XM```#YP````)?;'-S=7`N80```^@````"7T-/1$4```````/I```"`TCG(`)82
  718. XM@"0`<@`L>``$3JX``$J`9P8L0"S"(`Y,WT`$3G4O#D/H__P@$2QX``1.K@``C
  719. XM+%].=4Y5``!(Y^#R(&T`#$/M`!!%^@`6)FT`""QX``1.K@``3-]/!TY=3G46D
  720. XMP$YU3E7_U$CG."(K2/_X*TG__"QL``!.K@``(@!.K@``2H!G)DZN```B`$ZN^
  721. XM``!*@&<8D\DL>``$3JX``"!`*V@`I/_T2JW_]&8(<A=T36```3AX`'``($!.D
  722. XMN@&6*T#_[&<``3)P1$ZZ_S@K0/_P9P``?B1M_^PB0"!M__1P`4ZZ`1PL;```_
  723. XM3JX``"(`=@1![```)`@L;```3JX```R`````!&8``"PD/```)Q!.K@``(@!.J
  724. XMK@``2H!G```63JX``"(`=A!![?_8)`A.K@``*``D;?_L(FW_\"!M__1P`$ZZ@
  725. XM`+P@+?_P9P8@0$ZZ_M8@+?_L9P``H$ZZ`7X,A`````EO``"21>W_V`PJ`#L`[
  726. XM!&8``(0,,@!R0/]F``!Z6DIR`!(:!$$`,`P2`#MG&L+\``K2&@0!`#`,$@`[0
  727. XM9PK"_``*TAH$`0`P4DIT`!0:#`(`(&<``$(,`@`[9P``.@P"`')G```R!`(`X
  728. XM,`P2`"!G&L3\``K4&@0"`#`,$@`@9PK$_``*U!($`@`P(&W__""!(&W_^"""!
  729. XM3-]$'$Y=3G5(YP`V)D@J24'M`!0K2``*($TK2``4*TH`&"M\```#X@`<2D!G8
  730. XM```,*WS_____`"A@!$*M`"@@2R)-+'@`!$ZN```@2DZN```@2DZN``!,WVP`S
  731. XM3G5(YP4F*D@J`'#_+'@`!$ZN```,@/____]F!G``8```8BX`<").NOV*2H!FQ
  732. XM#"`'3JX``'``8```2B1`)4T`"A5%``D5?``$``@5?`````X51P`/D\E.K@``+
  733. XM)4``$+O\`````&<*(DI.K@``(`I@$D'J`!0@B%B00J@`!"%(``@@"DS?9*!.V
  734. XM=4CG``8J0"QX``1*K0`*9P8B0$ZN```;?`#_``@K?/____\`%'``$"T`#TZN5
  735. XM```@34ZZ_1I,WV``3G5.50``2.<?,B9)(DA^3BH1;0``O(K\!;4@!4C%Y8W>(
  736. XMA4A`.@!*16<8/#P!;3`'`D```V8"4D:Z1FT&FD92AV#D>`!\`%)%0>P``!PPK
  737. XM0``,1``!9@HP!P)```-F`E)&ND9O"II&4D0,1``,;=X,AP```&-O"`2'````+
  738. XM9&#P("D`"(#\`#)(P"\`("D`!"(`@/P`/'8`-@#`_``\DD`O`2\#2&P``"\MY
  739. XM``A.NOQ\3^\`%"\%4D0O!"\'2&P``"\+3KK\9D_O`!1,WTSX3EU.=4/L```@C
  740. XM;0`(3KD`````0^P``"!+3KD`````8-QP`!`89PX,```J9P8,```_9O!P`4YU>
  741. XM3E7_P$CG$#`D2"9)0>W_P$/M_\1V`$H29@9*$V<``)@,$P`J9D(,0P!`9P``-
  742. XMCB&+,``CBC``4$-22V#:44,@"$I#;0P@<3@`2A!F!%%#8/!*0VUF($`F<#``J
  743. XM4DM2L3``)'$X`%!#8*X,$P`_9@I*$F8T2D-G1&#$$!(,``!`8PH,``!:8@0&+
  744. XM```@$A,,`0!`8PH,`0!:8@0&`0`@L@!G!DI#9Q9@EDH29P)22DH39P922V``Z
  745. XM_V)P`6`"<`!,WPP(3EU.=4CG,"`D`"8L```(`P`19B(@*``$L*D`!&T&9Q9PS
  746. XM`&`"<`$(`P`09P``@`A```!@``!X"`,`!F8``&1*0F8V4(A0B4H09R@2&0P!*
  747. XM`$!C"@P!`%IB!`8!`"`0&`P``$!C"@P``%IB!`8``""R`&?4D`%N)F`H4T)F)
  748. XM#B`H`'RPJ0!\;A9M&&"X0>@`A$/I`(1.N@`>2H!GJ&T$<`%@`G``"`,`"6<$7
  749. XM"$```$S?!`Q.=2`0D)%F%"`H``20J0`$P?P+N-"H``B0J0`(3G5(YR`V)"P`S
  750. XM`"9()$DJ4TJ59Q8B:@`((&T`""`"3KK_&$I`9@0J56#F($LB2B1M``0L>``$K
  751. XM3JX``$S?;`1.=4CG`#8D2"9)3KD`````2H!G("I`(#P```$$(FT`""!++'@`C
  752. XM!$ZN```B32!*3KK_E'`!3-]L`$YU<`!.=2\*<``D24H99OP2(0P!`#IG'`P!7
  753. XM`"]F$+/*9Q(,*0`O__]G"E-)8`:SRF+>8`JSRF4&$-I20&#V0A`D7TYU+PIP2
  754. XM`"1)2AEF_!(A#`$`.F<,#`$`+V<&L\IB[F`"4DD0V6<$4D!@^"1?3G53@&T$:
  755. XM$-EF^$(0(`A.=;/(90S0P-+`$R!30&[Z8`82V%-`;OI.=;`09PI*&&<"8/9P0
  756. XM`$YU(`A.=4CG/3(F""1)0A)Z`"`\```!!$ZZ^3(N`&<``(HL;```2H-G2"(#A
  757. XM)`=.K@``2H!G=")'#"D`(``(91A*$F<*0^P``"!*3KH`>")'4(D@2DZZ`&XH_
  758. XM`R(#3JX``"8`2D5F!'H!8+PB!$ZN``!@M")'#"D`(``(9`Q#[```($I.N@!`G
  759. XM8"AP+R!*3KK_9DJ`9P@@0!"\`#I@%$/L```@2DZY`````&`&0A)V`&`"=@%*$
  760. XMAV<&($=.NOBT(`-,WTR\3G5(YP$P)DDD2"!+3KD`````+@`@2DZY`````%)`&
  761. XM(DK2QR!*3KK^]#`'(DH@2TZZ_NI,WPR`3G5R9W`40>P``$ZY`````$YU2.<X<
  762. XM`B0(+&P``$ZN```F`"`\```!+$ZZ^"HH`&8&3KK_T&`B+P)(;```+P1.NOA*J
  763. XM3^\`#"(#<!0@1$ZY`````"!$3KKX($S?0!Q.=0`````#[X$```)`<W1R8V%TR
  764. XM``````$```=8@0```D!S=')L96X``````@``!X0```>.@0```D!S='!C<'D`#
  765. XM`````@```^@```/T@0```D!#;&5A;E5P`````@``![@```?Z@0```T!!;&QO=
  766. XM8T9I8@````````$```7F@P```U],5D]);G!U=`````````,```!X```!#@``0
  767. XM`1Z#```#7TQ63T-O<'E-96T``````0``!@*#```"7TQ63U)E860````!```!+
  768. XM+(,```1?3%9/06QL;V-3:6=N86P``````0```F"#```$7TQ63U!A<F5N=$1I=
  769. XM<@````````$```<2@P```U],5D]296U0;W)T``````$```+J@P``!%],5D]7&
  770. XM86ET1F]R0VAA<@`````!```!%(,```-?3%9/1V5T37-G```````!```"2(,`D
  771. XM``-?3%9/06QL;V--96T````!````$(,```-?3%9/56Y,;V-K```````!```'8
  772. XM(H,```-?3%9/1FEN9%1A<VL````"````F@```J:#```#7TQ63TEN<V5R=```;
  773. XM`````0``!=2#```%7TQ63TES26YT97)A8W1I=F4````````"````?@```(R#[
  774. XM```$7TQ63T9R9653:6=N86P```````(```*````#`H,```-?3%9/4'5T37-GS
  775. XM```````!```"/(,```-?3%9/4F%W1&]&;70````!````5(,```-?3%9/3W5T\
  776. XM<'5T```````"````A@```.B#```#7TQ63U=A:710;W)T`````0```D*#```#D
  777. XM7TQ63T9R965-96T``````0```#"#```#7TQ63TEO17)R`````````0``!\J#N
  778. XM```#7TQ63T5X86UI;F4``````0``!N2#```#7TQ63U=R:71E`````````0``G
  779. XM`/J#```#7TQ63T%D9%!O<G0``````0```KB&```"7T1/4T)A<V4````%````&
  780. XM=````.0```#V```&V```!\:&```"7V1A=&5P870````!```#RH8```)?3%-&=
  781. XM;&%G<P````$```3<A@```E]T:6UE<&%T`````0```[*&```$7V1A>7-P97)MG
  782. XM;VYT:`````````$```-8A@``!%].;T9I;F1&;713='(````````!```'YH8`0
  783. XM``)?9W=B<G-T<@````$```#PA@```E]S;W)T:V5Y`````0``!:2&```#7V)AJ
  784. XM9&1A=&5S='(``````0```^Z&```#7TYO4D%-37-G`````````0``![2&```#^
  785. XM7V)A9'1I;65S='(``````0```^"&```#7T-O;&]N4W1R`````````0``!U*&N
  786. XM```#7U-L87-H4W1R`````````0``!OJ&```#7U)A;4YA;653='(``````0``:
  787. XM!S(!```"0&UY9G)E90`````B`0```D!I<W=I;&0````#^@$```1`26YS97)TL
  788. XM1FEB3F]D90`````%G@$```)?86UO=FUE;0``!I`!```#0$-O;7!&:6)S````[
  789. XM```$U`$```1`1V5T1FEL95-T<FEN9P`````&5@$```5`26YS97)T4&%T:%-T?
  790. XM<FEN9P``````!W@!```$0$=E=%!A=&A3=')I;F<`````!A@!```#0&%S=')NB
  791. XM8W!Y```````&@@$```-`3F]&:6QE17AI=`````>^`0```T!N=6QL<W1U8@``Q
  792. XM````!A0!```%0$-O;7!A<F5$871E4W1A;7!S``````6"`0``!%]3971#;VYS'
  793. XM;VQE5'EP90````'\`0``!$!&:6QL1FEB16YT<GD```````7<`0```T!&:6)&*
  794. XM:6QE1&%T90```Q`!```"0&UY86QL;V,``````0```E]K<'5T,0``````7@$`U
  795. XM``1`1V5T5VEN0F]U;F1S````````8@$```-`=VEL9&UA=&-H``````00`0``U
  796. XM!$!-86ME4&%T:%-T<FEN9P````:Z`0```U]A<W!R:6YT9@```````#8!```#*
  797. XM0$YO365M17AI=``````'K@$```-?1&5L971E4&]R=`````+6`0```U]#<F5A\
  798. XM=&50;W)T`````E`!```"0&%I;F1E>`````:H`````````_`````"7VES8VAK@
  799. XM,0````/\`````E]G=V)D;VYE```!]`````)?86EF;W5N9```!K8````"0&UY7
  800. XM9G)E90`````B`````U]W;6EN8W!O:6YT````!+8````"0&ES=VEL9`````/ZS
  801. XM````!$!);G-E<G1&:6).;V1E``````6>`````U]F9F1G971D87D``````U``6
  802. XM```"7V=P<V1O;F4```90`````U]W;6YO='%M87)K````!(@````"7V-F;G-I:
  803. XM>F4```5:`````E]A;6]V;65M```&D`````-`0V]M<$9I8G,```````34````5
  804. XM`U]A:6YO;6%T8V@`````!K(````#7VUP<V9A:6QE9``````'7@````)?;7!S[
  805. XM9&]N90``!V0````$0$=E=$9I;&53=')I;F<`````!E8````"7VES=V1O;F4`B
  806. XM``0,````!4!);G-E<G10871H4W1R:6YG```````'>`````-?=VUM871C:&5DI
  807. XM``````3&`````U]G=V)F<F5E<&%C:P```4(````#7V=W8G5P9&%T90`````!6
  808. XMZ`````1`1V5T4&%T:%-T<FEN9P`````&&`````)?;7!S;VMA>0``!R8````##
  809. XM7V=W8F=O=&-O;@``````L@````-?=VUN;VUA=&-H``````3*`````T!A<W1R6
  810. XM;F-P>0``````!H(````"7V%M9&]N90````:F`````U]F9F1B861D871E````:
  811. XM`]X````#0$YO1FEL945X:70````'O@````)?8W!D;VYE`````M`````#0&YU2
  812. XM;&QS='5B```````&%`````-?8V9N86QP:&$```````5(````!4!#;VUP87)EH
  813. XM1&%T95-T86UP<P`````%@@````-?=VUB86-K960```````1@````!%]3971#3
  814. XM;VYS;VQE5'EP90````'\`````U]C<&=O='!O<G0``````H@````"7V-F97AIM
  815. XM=`````5R`````E]I=V1O;F4````$#@````)?=VUB86-K,0``!%`````#7V=W_
  816. XM8F9R965P;W)T```!3@````)?8V9T<G5E````!6P````"7W=M9&]N90````3,N
  817. XM````!$!&:6QL1FEB16YT<GD```````7<`````U]W;6=O8F%C:P``````!$P`,
  818. XM```#7V9F9&=E=&UO```````#,`````-?8V9T<W1S;W)T``````4&`````E]G"
  819. XM9G-C<'D````&=@````-`1FEB1FEL941A=&4```,0`````U]W;6YO='-T87(`7
  820. XM````!'@````"0&UY86QL;V,``````````U]C<&YO;F%M90```````KX````#E
  821. XM7V1P;F]N86UE```````"[`````-?;7!S9&5A;&P```````=F`````E]C9F5X'
  822. XM:70P```%?`````)?:W!U=#$``````%X````"7V=P<V-P>0````9&`````U]W>
  823. XM;6YA;65N9```````!+P````$0$=E=%=I;D)O=6YD<P```````&(````#7V9FM
  824. XM9'!R:6YT```````#?`````-`=VEL9&UA=&-H``````00`````U]L8V-E;W-TS
  825. XM<@``````!4(````#7V-P9V]T<VEG```````"<`````-?;&-C<W1A<G0`````O
  826. XM``46````!$!-86ME4&%T:%-T<FEN9P````:Z`````U]A<W!R:6YT9@``````J
  827. XM`#8````#7VUP<V9I;FES```````'<`````)?=VUL;V]P,0``!"8````"7V-F\
  828. XM86QP:&$```42`````E]C9F9A;'-E```%<`````)?9F9D9&]N90```]8````#:
  829. XM0$YO365M17AI=``````'K@````-?=VUN;W1E;VX```````0P`````U]G=V)S-
  830. XM971C;V]K`````3`````#7T1E;&5T95!O<G0````"U@````-?0W)E871E4&]R/
  831. XM=`````)0`````D!A:6YD97@````&J`````-?9W=B;F]W8G)E<`````"J````X
  832. X%`````_)0%
  833. X``
  834. Xend
  835. Xsize 5180
  836. END_OF_FILE
  837. if test 7291 -ne `wc -c <'src/lssup.o.uu'`; then
  838.     echo shar: \"'src/lssup.o.uu'\" unpacked with wrong size!
  839. fi
  840. # end of 'src/lssup.o.uu'
  841. fi
  842. if test -f 'src/mycres.a' -a "${1}" != "-c" ; then 
  843.   echo shar: Will not clobber existing file \"'src/mycres.a'\"
  844. else
  845. echo shar: Extracting \"'src/mycres.a'\" \(5160 characters\)
  846. sed "s/^X//" >'src/mycres.a' <<'END_OF_FILE'
  847. X* mycres.a - Specialized C initial startup procedure under AmigaDOS
  848. X* Adapted for LS use from c.a by Justin V. McCormick 89-05-12
  849. X* Converted to CAPE 89-06-03
  850. X*
  851. X    IFD    CAPE            ; Special OP flags for CAPE
  852. X
  853. X    CSYMFMT
  854. X    BASEREG    B
  855. X    SMALLOBJ
  856. X    OPTIMON
  857. X    ADDSYM
  858. X    include "work:ipre.i"        ; A precompiled collection of the below...
  859. X
  860. X    ELSE
  861. X
  862. X    INCLUDE    "exec/types.i"
  863. X    INCLUDE    "exec/alerts.i"
  864. X    INCLUDE    "exec/nodes.i"
  865. X    INCLUDE    "exec/lists.i"
  866. X    INCLUDE    "exec/ports.i"
  867. X    INCLUDE    "exec/libraries.i"
  868. X    INCLUDE    "exec/tasks.i"
  869. X    INCLUDE    "exec/memory.i"
  870. X    INCLUDE    "exec/execbase.i"
  871. X    INCLUDE    "libraries/dos.i"
  872. X    INCLUDE    "libraries/dosextens.i"
  873. X    INCLUDE    "workbench/startup.i"
  874. X    INCLUDE    "exec/funcdef.i"
  875. X    INCLUDE    "exec/exec_lib.i"
  876. X    INCLUDE    "libraries/dos_lib.i"
  877. X
  878. X    ENDC
  879. X
  880. X    
  881. XMEMFLAGS    EQU    MEMF_CLEAR+MEMF_PUBLIC
  882. X
  883. X; some usefull macros:
  884. X
  885. XSYS    MACRO    *
  886. X    IFGT    NARG-2
  887. X    FAIL    !!!
  888. X    ENDC
  889. X    IFEQ    NARG-2
  890. X    MOVE.L    \2,a6
  891. X    ENDC
  892. X    JSR    _LVO\1(a6)
  893. X    ENDM
  894. X    
  895. X    XDEF    XCEXIT            ; exit(code) is standard way to leave C.
  896. X    XDEF    @XCEXIT
  897. X
  898. X    XREF    @myalloc
  899. X    XREF    @myfree
  900. X    XREF    @astrncpy        ; String copy routine
  901. X    XREF    DOSBase
  902. X    XREF    LinkerDB        ; linker defined base value
  903. X    XREF    NEWDATAL
  904. X    XREF    RESBASE
  905. X    XREF    RESLEN
  906. X    XREF    _BSSBAS            ; linker defined base of BSS
  907. X    XREF    _BSSLEN            ; linker defined length of BSS
  908. X    XREF    @_main            ; Name of C program to start with.
  909. X;    XREF    @MemCleanup        ; Free all allocated memory
  910. X
  911. X    SECTION    CODE
  912. X* --------------------------------------------------------------------- *
  913. Xstart:
  914. X    move.l    a0,a2            ; save command pointer
  915. X    move.l    d0,d2            ; and command length
  916. X    lea    LinkerDB,a4        ; load base register
  917. X
  918. X    movem.l    d0-d1/a0-a2,-(sp)
  919. X    sub.l    #RESBASE,a4
  920. X    move.l    #RESLEN,d0
  921. X    move.l    #MEMFLAGS,d1
  922. X    SYS    AllocMem,4
  923. X    tst.l    d0
  924. X     bne    1$
  925. X    movem.l    (sp)+,d0-d1/a0-a2
  926. X    rts
  927. X    
  928. X1$
  929. X    move.l    d0,a0
  930. X    move.l    d0,a2
  931. X
  932. X; a2 now has difference
  933. X    move.l    d0,a1
  934. X    move.l    #NEWDATAL,d0
  935. X; copy data over
  936. Xcpy:
  937. X    move.l    (a4)+,(a0)+
  938. X    subq.l    #1,d0
  939. X    bne    cpy
  940. X; a4 now points at number of relocs
  941. X    move.l    (a4)+,d0
  942. Xreloc:
  943. X     beq.s    nreloc
  944. X    move.l    a1,a0
  945. X    add.l    (a4)+,a0        ; a0 now has add of reloc
  946. X    add.l    (a0),a2
  947. X    move.l    a2,(a0) 
  948. X    move.l    a1,a2            ; restore offset
  949. X    subq.l    #1,d0
  950. X    bra    reloc
  951. X
  952. Xnreloc:
  953. X     move.l    a1,A4            ; set up new base register
  954. X    add.l    #RESBASE,A4
  955. X    movem.l    (sp)+,d0-d1/a0-a2
  956. X
  957. X    movea.l    4,a6
  958. X    move.l    a6,SysBase(A4)
  959. X    move.l    sp,_StackPtr(A4)    ; Save stack ptr
  960. X
  961. X; get the address of our task
  962. X    move.l    ThisTask(a6),a3
  963. X
  964. X; clear any pending signals
  965. X    moveq    #0,d0
  966. X    move.l    #$00003000,d1
  967. X    SYS    SetSignal
  968. X    
  969. X; are we running as a son of Workbench?
  970. X    tst.l    pr_CLI(a3)
  971. X     bne.s    fromCLI
  972. X
  973. X* --------------------------------------------------------------------- *
  974. X* Workbench Startup Code
  975. XfromWorkbench:
  976. X; wait for a message from our starter
  977. X    lea    pr_MsgPort(a3),a0    ; our process base
  978. X    SYS    WaitPort
  979. X    lea    pr_MsgPort(a3),a0    ; our process base
  980. X    SYS    GetMsg
  981. X    move.l    d0,d2
  982. X     beq.w    exitToDOS
  983. X
  984. X; return the startup message to our parent
  985. X; we forbid so workbench can't UnLoadSeg() us
  986. X; before we are done:
  987. X    SYS    Forbid
  988. X    movea.l    d2,a1
  989. X    SYS    ReplyMsg
  990. X    bra.w    exitToDOS
  991. X
  992. X* --------------------------------------------------------------------- *
  993. X* CLI Startup Code
  994. X; Entry: d2 = command length
  995. X;     a2 = Command pointer
  996. XfromCLI:
  997. X; attempt to open DOS library:
  998. X    lea    DOSName(PC),a1
  999. X    moveq    #0,d0
  1000. X    SYS    OpenLibrary
  1001. X    move.l    d0,DOSBase(A4)
  1002. X     bne.s    1$
  1003. X    moveq    #100,d0
  1004. X    bra.s    exit2
  1005. X1$
  1006. X; find command name:
  1007. X    move.l    pr_CLI(a3),a3
  1008. X    add.l    a3,a3            ; bcpl pointer conversion
  1009. X    add.l    a3,a3
  1010. X    move.l    cli_CommandName(a3),a3
  1011. X    add.l    a3,a3            ; bcpl pointer conversion
  1012. X    add.l    a3,a3
  1013. X
  1014. X; collect parameters:
  1015. X    move.l    d2,d0            ; get command line length
  1016. X    moveq.l #0,d1
  1017. X    move.b    (a3)+,d1
  1018. X    add.l    d1,d0            ; add length of command name
  1019. X    addq.l    #1,d0            ; allow for space after command 
  1020. X    jsr    @myalloc        ; allocate enough space for whole cmd line
  1021. X    tst.l    d0
  1022. X     beq.s    closeDOS        ; Oops, allocate failed
  1023. X    move.l    d0,_CmdLine(A4)
  1024. X
  1025. X; copy command name into allocated space
  1026. X    movea.l    a3,a1
  1027. X    movea.l    d0,a0
  1028. X    moveq    #0,d0
  1029. X    move.b    -1(a3),d0
  1030. X    jsr    @astrncpy
  1031. X
  1032. X; insert a space unless command itself is the only argument
  1033. X    cmpi.w    #2,d2
  1034. X     bcs.s    2$
  1035. X    move.b    #' ',(a0)+
  1036. X    
  1037. X; Append/copy command line into allocated space
  1038. X    move.l    d2,d0
  1039. X    movea.l    a2,a1
  1040. X    jsr    @astrncpy
  1041. X2$
  1042. X    movea.l    _CmdLine(A4),a0        ; push command line address
  1043. X
  1044. X* --------------------------------------------------------------------- *
  1045. X* Call @_main
  1046. Xmain:
  1047. X    jsr    @_main            ; call C entrypoint
  1048. X    moveq.l #0,d0            ; set successful status
  1049. X    bra.s    exit2
  1050. XXCEXIT:
  1051. X    move.l    4(sp),d0        ; extract exit return code
  1052. X@XCEXIT:
  1053. Xexit2:
  1054. X    move.l    d0,-(sp)        ; Save exit return status
  1055. X
  1056. X    movea.l    _CmdLine(A4),a0
  1057. X    jsr    @myfree            ; Free command line
  1058. X
  1059. X;    jsr    @MemCleanup        ; Free malloced resources
  1060. X
  1061. XcloseDOS:
  1062. X; Close the DOS library
  1063. X    move.l    DOSBase(A4),a1
  1064. X    SYS    CloseLibrary,4        ; close Dos library
  1065. X
  1066. X; this rts sends us back to DOS:
  1067. XexitToDOS:
  1068. X    move.l    #RESLEN,d0
  1069. X    movea.l    A4,a1
  1070. X    suba.l    #RESBASE,a1
  1071. X    move.l    (sp)+,d7        ; Grab exit return code
  1072. X    movea.l _StackPtr(A4),sp    ; restore stack ptr
  1073. X    SYS    FreeMem,4
  1074. X    move.l    d7,d0            ; Put exit return code in d0
  1075. X    rts
  1076. X
  1077. X*-----------------------------------------------------------------------
  1078. XDOSName    dc.b    'dos.library',0
  1079. X
  1080. X
  1081. X    SECTION _MERGED,BSS
  1082. X* --------------------------------------------------------------------- *
  1083. X    XDEF    _CmdLine
  1084. X    XDEF    SysBase
  1085. X    XDEF    _StackPtr
  1086. X_CmdLine:
  1087. X    ds.b    4
  1088. XSysBase:
  1089. X    ds.b    4
  1090. X_StackPtr
  1091. X    ds.b    4
  1092. X    END
  1093. END_OF_FILE
  1094. if test 5160 -ne `wc -c <'src/mycres.a'`; then
  1095.     echo shar: \"'src/mycres.a'\" unpacked with wrong size!
  1096. fi
  1097. # end of 'src/mycres.a'
  1098. fi
  1099. if test -f 'src/mycres.o.uu' -a "${1}" != "-c" ; then 
  1100.   echo shar: Will not clobber existing file \"'src/mycres.o.uu'\"
  1101. else
  1102. echo shar: Extracting \"'src/mycres.o.uu'\" \(1583 characters\)
  1103. sed "s/^X//" >'src/mycres.o.uu' <<'END_OF_FILE'
  1104. Xbegin 644 mycres.o
  1105. XM```#YP````````/H`````E]#3T1%```````#Z0```%@D2"0`2?D`````2.?`6
  1106. XMX)G\`````"`\`````"(\``$``2QX``1.KO\Z2H!F```(3-\'`TYU($`D0")`D
  1107. XM(#P`````(-Q3@&;Z(!QG#B!)T=S5T""*)$E3@&#P*$G9_`````!,WP<#+'@`0
  1108. XM!"E.```I3P``)FX!%'``(CP``#``3J[^SDJK`*QF)$'K`%Q.KOZ`0>L`7$ZN3
  1109. XM_HPD`&<``)I.KO]\(D).KOZ&8```C$/Z`*AP`$ZN_=@I0```9@1P9&!>)FL`2
  1110. XMK-?+U\LF:P`0U\O7RR`"<@`2&]"!4H!.N0````!*@&=&*4```")+($!P`!`K8
  1111. XM__].N0`````,0@`"90X0_``@(`(B2DZY`````"!L``!.N0````!P`&`$("\`_
  1112. XM!"\`(&P``$ZY`````")L```L>``$3J[^8B`\`````"),D_P`````+A\N;```8
  1113. XM+'@`!$ZN_RX@!TYU9&]S+FQI8G)A<GD````#[X$```)?4D530D%310````,``
  1114. XM```0````7````3Z!```"0&UY9G)E90`````!```!)($```-`87-T<FYC<'D`4
  1115. XM```````"````\@```0:!```"0%]M86EN```````!```!$($```)?4D533$5._
  1116. XM``````(````6```!-H$```-?3&EN:V5R1$(````````!````!H$```-?3D57Q
  1117. XM1$%404P````````!````/($```)`;7EA;&QO8P````$```#:A@```E]$3U-"!
  1118. XM87-E`````@```+8```$JA@```E]3>7-"87-E`````0```&J&```#7U]3=&%CZ
  1119. XM:U!T<@```````@```&X```%&A@```U]?0VUD3&EN90````````,```#D```!C
  1120. XM#````2`!```"0%A#15A)5`````$<`0```E]80T58250````!&`````````/PE
  1121. XM`````E]$3U-.86UE```!5`````)?9G)O;4-,20```*H````"7W-T87)T````#
  1122. XM`````````D!80T58250````!'`````)?;6%I;@```````0X````"7VYR96QO*
  1123. XM8P````!8`````U]E>&ET5&]$3U,``````30````"7V5X:70R``````$<````?
  1124. XM`E]80T58250````!&`````1?9G)O;5=O<FMB96YC:```````A@````-?8VQOO
  1125. XM<V5$3U,```````$H`````5]C<'D```!``````E]R96QO8P``````2```````1
  1126. XM``/R```#Z`````)?7TU%4D=%1````^L````#```#[P$```)?4WES0F%S90``3
  1127. XM``0!```#7U]3=&%C:U!T<@``````"`$```-?7T-M9$QI;F4`````````````8
  1128. XM`````_`````"7U-Y<T)A<V4````$`````U]?4W1A8VM0='(```````@````#*
  1129. X87U]#;61,:6YE``````````````````/R/
  1130. X``
  1131. Xend
  1132. Xsize 1104
  1133. END_OF_FILE
  1134. if test 1583 -ne `wc -c <'src/mycres.o.uu'`; then
  1135.     echo shar: \"'src/mycres.o.uu'\" unpacked with wrong size!
  1136. fi
  1137. # end of 'src/mycres.o.uu'
  1138. fi
  1139. echo shar: End of archive 1 \(of 3\).
  1140. cp /dev/null ark1isdone
  1141. MISSING=""
  1142. for I in 1 2 3 ; do
  1143.     if test ! -f ark${I}isdone ; then
  1144.     MISSING="${MISSING} ${I}"
  1145.     fi
  1146. done
  1147. if test "${MISSING}" = "" ; then
  1148.     echo You have unpacked all 3 archives.
  1149.     rm -f ark[1-9]isdone
  1150. else
  1151.     echo You still need to unpack the following archives:
  1152.     echo "        " ${MISSING}
  1153. fi
  1154. ##  End of shell archive.
  1155. exit 0
  1156. -- 
  1157. Mail submissions (sources or binaries) to <amiga@cs.odu.edu>.
  1158. Mail comments to the moderator at <amiga-request@cs.odu.edu>.
  1159. Post requests for sources, and general discussion to comp.sys.amiga.
  1160.